<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<h1>websocket</h1>
<script>
    var websock

    function connect(uuid) {
        websock = new WebSocket('ws://localhost:8080/socket/video/' + uuid)
        websock.onopen = function () {
            alert('ws://localhost:8080/socket/video/' + uuid + '=>打开成功')
        }
        websock.onmessage = function (event) {
            alert('收到消息' + event.data)
        }
        websock.onclose = function () {
            alert('断开链接')
        }
        websock.onerror = () => {
            alert('错误')
        }
    }

</script>
</body>
</html>